Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Add  Multiple  Tables  to  a  Word  Document  

 Content of Add Multiple Tables to a Word Document.js
MD5 Hash: 6A40F322098C34BB2172DE8DA31E1BA1
var end_of_story = 6;

var objword = new ActiveXObject("word.application");
objword.visible = true;

var objdoc = objword.documents.add();
var objselection = objword.selection;

objselection.typetext ("table 1");
objselection.typeparagraph();

var objrange = objselection.range;
objdoc.tables.add (objrange, 1, 2);
var objtable = objdoc.tables(1);

objtable.cell(1, 1).range.text = "this is cell 1.";
objtable.cell(1, 2).range.text = "this is cell 2.";
objselection.endkey (end_of_story);
objselection.typeparagraph();

objselection.typetext ("table 2");
objselection.typeparagraph();

var objrange = objselection.range;
objdoc.tables.add (objrange, 1, 2);
var objtable = objdoc.tables(2);

objtable.cell(1, 1).range.text = "this is cell 1.";
objtable.cell(1, 2).range.text = "this is cell 2.";

objselection.endkey (end_of_story);
objselection.typeparagraph();



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a